import 'dart:core';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
  runApp(
    MaterialApp(home: TextHomePage()),
  );
}

class TextHomePage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return TextHomePageState();
  }
}

class TextHomePageState extends State<TextHomePage> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: AppBar(
              title: const Text("listview"),
            ),
            body: Listener(
              onPointerDown: (event){
                print("指针按下${event}");
              },
              onPointerMove: (event){
                print("指针按移动${event}");
              },
              onPointerUp: (event){
                print("指针抬起${event}");
              },
              onPointerCancel: (event){
                print("指针取消${event}");
              },
              child: Container(
                width: 300,
                color: Colors.red,
                height: 300,
              ),
            )
        )
    );
  }
}
